Importing other scripts

 When you add a script to Extender, the script is imported in the database. You can import such scripts into another script in your database. This is described in the knowledge base article below.

If you create a module with a ModuleID, in Extender you can upload a script called: ModuleID.mySharedScript.py

In another script, you can import the script using standard Python import feature. You just need to replace the colon (.) with an underscore (_) so that Extender knows to include this file first. ModuleID_mySharedScript

Copy
import ModuleID_mySharedScript
Note:

If you password protect the script in Extender scripts, you can also import the script: 

Copy

Importing password protected script

protected = importScript("protected")
protected.myFunc()
Example:

If your module is called "CUSTOMSAGE" then:

a) Include your common functions in a script called CUSTOMSAGE.myExtenderChanges.py b) To import from the shared script in a separate script (in the same database), called CUSTOMSAGE.myScript.py, you can use the standard Python import feature.

Extender implicitly uses the .py extension, so you don't need to include it when importing

Copy
from CUSTOMSAGE_myExtenderChanges import *

Tip:

You can use a module for general functions and classes that you use in several scripts. We will use the Orchid Tools module as a reference a bit later.